In the prior art, a program sends a request to an operating system, requesting the operating system to execute a task. The operating system allocates a resource for execution of the task requested by the program, creates a thread, loads task parameters and the like to the thread, and places the thread loaded with the task parameters in, for example, a scheduling queue, awaiting a resource to be scheduled by the operating system to execute the thread.
The operating system releases the resource occupied by the executed thread and feeds back an execution result if no exception occurs during execution, and when execution of the thread ends. The thread is re-placed in a waiting queue until the exception is eliminated and the operating system schedules the thread again to continue execution if an exception occurs during execution of the thread.
The inventor finds in research that high overheads are incurred when the operating system creates and releases a thread resource for each task. Especially when a large number of small tasks are executed, overheads for creating and releasing a thread resource for each task account for a large proportion of total running time, reducing system resource utilization.